package hospital.example;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class Person {
    private String name;
    private List<Card> cards = new ArrayList<>();
    Person(String name){
        this.name = name;
    }
    public void add(Card card){
        cards.add(card);
    }
    public String getName(){
        return name;
    }
    public void addAll(List<Card> card){
        cards.addAll(card);
    }
    public void cardShow(){
        System.out.println("用户" + name + "拥有" +cards.size() + "牌如下：");
        Collections.sort(cards);
        System.out.println(cards);
    }

}
